package com.lx.base.datacopy.impl;

import com.alibaba.fastjson.JSONObject;
import com.lx.base.datacopy.DataCopy;
import org.springframework.util.StringUtils;

import java.util.List;

public class ListCopy implements DataCopy {

    @Override
    public String converter(String sourceJonString, Class<?> targetType) {
        if (StringUtils.isEmpty(sourceJonString)) {
            return null;
        }
        List list= JSONObject.parseObject(sourceJonString,List.class);
        return String.join(",",list);
    }
}
